<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>传递自定义参数，事件修饰符</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
    <div id="app">
        <!-- <input type="button" value="点击" @click="doIt(666,'老铁！')"> -->
         <button @click="doIt(666,'老铁！')">点击</button>
        <!-- 事件修饰符，当按下回车会触发事件 -->
        <input type="text" name="" id="" @keyup.enter="sayHi">
    </div>
    <script>
        var app = new Vue({
            el: "#app",
            data: {

            },
            methods: {
                doIt: function(p1,p2){//参数接收数据
                    console.log("做IT");
                    console.log(p1);
                    console.log(p2);
                },
                sayHi: function(){
                    alert('吃了吗？')
                }
            }
        })
    </script>
</body>
</html>